import * as types from './mutations_types';

export default {
	show_loading: ({ commit }) => {
		return new Promise((resolve, reject) => {
			commit(types.SHOW_LOADING);
			resolve();
		});
	},

	hide_loading: ({ commit }) => {
		return new Promise((resolve, reject) => {
			commit(types.HIDE_LOADING);
			resolve();
		});
	},

	toast: ({ commit }, param) => {
		return new Promise((resolve, reject) => {
			commit(types.TOAST, param);
			resolve();
		});
	},

	ctrl_customer: ({ commit }, param) => {
		return new Promise((resolve, reject) => {
			commit(types.CTRL_CUSTOMER, param);
			resolve();
		});
	},

	ctrl_notice: ({ commit }, param) => {
		return new Promise((resolve, reject) => {
			commit(types.CTRL_NOTICE, param);
			resolve();
		});
	},

	ctrl_tabbar: ({ commit }, param) => {
		return new Promise((resolve, reject) => {
			commit(types.CTRL_TABBAR, param);
			resolve();
		});
	},

	user_data: ({ commit }, param) => {
		return new Promise((resolve, reject) => {
			commit(types.USER_DATA, param);
			resolve();
		});
	},

	header_data: ({ commit }, param) => {
		return new Promise((resolve, reject) => {
			commit(types.HEADER_DATA, param);
			resolve();
		});
	}
};
